// Decompiled by Jad v1.5.7g. Copyright 2000 Pavel Kouznetsov.
// Jad home page: http://www.geocities.com/SiliconValley/Bridge/8617/jad.html
// Decompiler options: packimports(3) fieldsfirst ansi 
// Source File Name:   ESSBean.java

package com.vandagroup.common.bo;

import java.io.Serializable;
import java.util.Vector;

// Referenced classes of package com.vandagroup.common.bo:
//            ESSObject

public class ESSBean extends ESSObject
    implements Serializable
{

    protected Vector list;

    public ESSBean()
    {
        list = null;
    }

    public void addBeanToList(ESSBean bean)
    {
        if(bean == null)
            return;
        if(list == null)
            list = new Vector();
        list.addElement(bean);
    }

    public void addBeansToList(ESSBean beans[])
    {
        if(beans == null)
            return;
        if(list == null)
            list = new Vector();
        for(int i = 0; i < beans.length; i++)
            list.addElement(beans[i]);

    }

    public ESSBean[] getBeans()
    {
        ESSBean beans[] = (ESSBean[])null;
        if(list != null)
        {
            beans = new ESSBean[list.size()];
            list.copyInto(beans);
        } else
        {
            beans = new ESSBean[1];
            beans[0] = this;
        }
        return beans;
    }

    public boolean removeBean(ESSBean bean)
    {
        if(list == null)
            return false;
        else
            return list.removeElement(bean);
    }

    public void removeBeanAt(int index)
    {
        if(list == null)
        {
            return;
        } else
        {
            list.removeElementAt(index);
            return;
        }
    }

    public int size()
    {
        if(list == null)
            return 1;
        else
            return list.size();
    }

    public ESSBean getBean(int index)
    {
        if(list == null)
            return this;
        else
            return (ESSBean)list.elementAt(index);
    }

    public void clearBeans()
    {
        list = null;
    }
}
